package com.gl.saasservice.repository;

import com.gl.saasservice.entity.UserDepartment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface UserDepartmentRepository extends JpaRepository<UserDepartment,Long>, JpaSpecificationExecutor<UserDepartment> {

    @Transactional
    void deleteByUserId(String id);

    List<UserDepartment> findByUserId(String id);

    List<UserDepartment> findByDepIdIn(List<Long> id);

    List<UserDepartment> findByUserIdIn(List<String> id );

    List<UserDepartment> findByDepId(Long depId);

}
